<%@LANGUAGE="VBSCRIPT"%>
 
<!--#include file="functions.asp" -->

<%
set CompCode = Server.CreateObject("ADODB.Recordset")
CompCode.ActiveConnection = cn
CompCode.Source = "SELECT *  FROM dbo.COMPCODE"
'CompCode.CursorType = 0
'CompCode.CursorLocation = 2
'CompCode.LockType = 3
CompCode.Open()
CompCode_numRows = 0
%>
<%
Dim EXIREG__tmpNum
EXIREG__tmpNum = "0"
if (Request.QueryString("Seqnum") <> "") then EXIREG__tmpNum = Request.QueryString("Seqnum")
%>
<%
set EXIREG = Server.CreateObject("ADODB.Recordset")
EXIREG.ActiveConnection = cn
EXIREG.Source = "SELECT LVONUM, SEQNUM, REGNUM, INVNUM, CREATEDBY, REQUESTEDBY, USERCOORDINATOR,STATUS, VENDORID, INVDATE, DUEDATE, INVRECBY,DEPT, MP2CURRENCY, SYMBOL, COMPCODE, VATNUM, WHTNAME, VATRATE, SUBTOTAL,WHTRATE, WHTAMOUNT, VATPAIDTOVENDOR,   (SELECT TOP 1 VENDOR.NAME  FROM VENDOR  WHERE VENDOR.VENDORID=EXILVOHEADER.VENDORID) AS VENDORNAME, (SELECT EMP.FIRSTNAME + ' '  + EMP.LASTNAME FROM dbo.EMP WHERE EMP.EMPCODE=EXILVOHEADER.INVAPPR) AS APPRNAME, (SELECT EMP.EMPCODE  FROM dbo.EMP WHERE (EMP.FIRSTNAME + ' '  + EMP.LASTNAME)=EXILVOHEADER.USERCOORDINATOR) AS UCNAME, INVVER,  (SELECT EMP.FIRSTNAME + ' '  + EMP.LASTNAME FROM dbo.EMP WHERE EMP.EMPCODE=EXILVOHEADER.INVVER) AS INVVERNAME,INVAPPR,COMMENTS  FROM dbo.EXILVOHEADER  WHERE LVONUM='" + Replace(EXIREG__tmpNum, "'", "''") + "'"
'EXIREG.CursorType = 0
'EXIREG.CursorLocation = 2
'EXIREG.LockType = 3
EXIREG.Open()
EXIREG_numRows = 0
%>
<%
dim UsrVer
dim UsrVerName
if (request.querystring("Route")="UC") then
UsrVer= EXIREG.Fields.Item("UCNAME").Value
UsrVerName= EXIREG.Fields.Item("USERCOORDINATOR").Value
else
UsrVer= EXIREG.Fields.Item("INVVER").Value
UsrVerName=EXIREG.Fields.Item("INVVERNAME").Value
end if

%>
<SCRIPT Language="JavaScript">
function DocLoad(){
document.form1.reqEndUser.focus();
}
function CheckEmp(y)
{ if (y!="") {
window.open("ValEmpl.asp?EmpID="+y+"&src=document.form1.reqEndUser&fld=document.form1.empName&fld2=document.form1.Dept","","width=300,height=120,Top=240,Left=240,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=no,")
} 
else 
{
document.form1.empName.value="";
document.form1.Dept.value="";}
}

function redirect(){
var InvStatus='<%= request.querystring("InvStatus") %>';
var dsort='<%= request.querystring("dsort") %>';
var dorder='<%= request.querystring("dorder") %>';
var Location='<%= request.querystring("Location") %>';
var UserCoord='<%= request.querystring("UserCoord") %>';
var RefOrder='<%= request.querystring("refOrder") %>';
var VendorID='<%= request.querystring("VendorID") %>';
var CurSymbol='<%= request.querystring("CurSymbol") %>';

location='InvList_LVO.asp?InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&Location='+Location+'&UserCoord='+UserCoord+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol;
return false
}
</SCRIPT>
<!-- #include file="pagetop.asp" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td nowrap height="21" bgcolor="#FFFFFF" width="3%" background="images/menu_end.gif">&nbsp;</td>
    <td nowrap height="21" bgcolor="#FFFFFF" width="28"> 
      <div align="center"><img src="images/menu_awal_off.gif" width="28" height="33"></div>
    </td>
    <td width="10%" background="images/menuoff.gif" height="21" nowrap> 
      <div align="center"><b><a href="#" class="menu" onclick="return redirect()">LVO List</a></b></div>
    </td>
    <td nowrap height="21" width="28"><img src="images/menu_off_on_separator.gif" width="28" height="33"></td>
    <td width="12%" background="images/menuon.gif" height="21" nowrap> 
      <div align="center" class="menu">Routing &amp; Approval</div>
    </td>
    <td height="21" width="11" bgcolor="#FFFFFF"><img src="images/Menu_onend.gif" width="13" height="33"></td>
    <td height="21" bgcolor="#FFFFFF" background="images/menu_end.gif"> 
      <div align="right"><b><font color="#003399">Invoice From LVO&nbsp;</font></b> 
      </div>
    </td>
  </tr>
  <tr bgcolor="#93bee2"> 
    <td height="21" width="3%" bgcolor="#93bee2">&nbsp;</td>
    <td height="21" width="28" bgcolor="#93bee2">&nbsp;</td>
    <td width="10%" height="21" bgcolor="#93bee2">&nbsp;</td>
    <td height="21" width="28">&nbsp;</td>
    <td width="10%" height="21">&nbsp;</td>
    <td height="21" width="11">&nbsp;</td>
    <td height="21">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#93bee2">
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td>&nbsp; </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF"><img src="images/curv_data.gif" width="21" height="21"></td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <form name="form1" method="post" action="Route_LVO.asp" onSubmit="return checkrequired(this)">
        <table width="100%" border="0" cellspacing="2" cellpadding="3">
          <tr> 
            <td width="15%" bgcolor="#dedede" height="25"> 
              <div align="right"><b>Register No.:&nbsp;</b></div>
            </td>
            <td width="2%" height="25">&nbsp;</td>
            <td width="30%" height="25"> <%=(EXIREG.Fields.Item("REGNUM").Value)%> 
              <input type="hidden" name="seqnum2" value="<%=(EXIREG.Fields.Item("LVONUM").Value)%>">
              <input type="hidden" name="ty" value="<%= request.querystring("ty") %>">
              <input type="hidden" name="order" value="<%= request.querystring("order") %>">
              <input type="hidden" name="sort" value="<%= request.querystring("sort") %>">
              <input type="hidden" name="Route" value="<%= request.querystring("Route") %>">
              <input type="hidden" name="myInvoice" value="N">
              <input type="hidden" name="trtype" value="Route">
              <input type="hidden" name="seqnum3" value="<%=(EXIREG.Fields.Item("SEQNUM").Value)%>">
            </td>
            <td width="15%" bgcolor="#dedede" height="25"> 
              <div align="right"><b>Invoice No.:&nbsp;</b></div>
            </td>
            <td width="2%" height="25">&nbsp;</td>
            <td height="25"> <b><%=(EXIREG.Fields.Item("INVNUM").Value)%></b> </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede" height="25"> 
              <div align="right"><b>Vendor ID:&nbsp;</b></div>
            </td>
            <td width="2%" height="25">&nbsp;</td>
            <td width="30%" height="25"> <%=(EXIREG.Fields.Item("VENDORID").Value)%> </td>
            <td width="15%" bgcolor="#dedede" height="25"> 
              <div align="right"><b>Received Date:&nbsp;</b></div>
            </td>
            <td width="2%" height="25">&nbsp;</td>
            <td bgcolor="#FFFFFF" height="25"><%= DoDateTime((EXIREG.Fields.Item("INVDATE").Value), 1, 2057) %> 
              <input type="hidden" name="VendorName" value="<%=(EXIREG.Fields.Item("VENDORNAME").Value)%>">
              <input type="hidden" name="InvoiceNo" value="<%=(EXIREG.Fields.Item("INVNUM").Value)%>">
            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede" height="25"> 
              <div align="right"><b>Vendor Name:&nbsp;</b></div>
            </td>
            <td width="2%" height="25">&nbsp;</td>
            <td height="25"> <%=(EXIREG.Fields.Item("VENDORNAME").Value)%> </td>
            <td height="25" bgcolor="#dedede"> 
              <div align="right"><b>Invoice Status:&nbsp;</b></div>
            </td>
            <td height="25">&nbsp;</td>
            <td height="25"><b><%=(EXIREG.Fields.Item("STATUS").Value)%></b></td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#FFFFFF"> 
              <div align="right"><b></b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td width="30%">&nbsp;</td>
            <td width="15%" bgcolor="#FFFFFF">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Route To 
                <% if (request.querystring("Route") = "UC") then %>
                User Coordinator 
                <% else %>
                End User 
                <% end if %>
                :&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td width="30%"> 
              <input type="text" name="reqEndUser" size="10" class="InputBox" value="<%= UsrVer %>" onBlur="CheckEmp(this.value);">
              <% if (request.querystring("Route") = "UC") then %>
              <input type="button" name="Submit2" value=" ... " onClick="openpopup('UCList.asp?fName=form1.reqEndUser&fName2=form1.empName&fName3=form1.Dept')" class="sbttn">
              <% else %>
              <input type="button" name="Submit2" value=" ... " onClick="openpopup('EmpList.asp?fName=form1.reqEndUser&fName2=form1.empName&fName3=form1.Dept')" class="sbttn">
              <% end if %>
            </td>
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Department:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="Dept" size="15" class="InputBox" value="<%=(EXIREG.Fields.Item("DEPT").Value)%>">
            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td width="30%"> 
              <input type="text" name="empName" size="30" class="InputBox" value="<%= UsrVerName %>">
            </td>
            <td width="15%"> 
              <div align="right"></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="hidden" name="RouteDate" value="<%= date %>">
            </td>
          </tr>
          <tr> 
            <td width="15%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td width="30%">&nbsp;</td>
            <td width="15%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#FFFFFF"> 
              <div align="right"><b>&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"> <b>Comments:</b><br>
              <textarea name="Comments1" cols="60" rows="6" class="InputBoxCopy" readOnly=true><%=(EXIREG.Fields.Item("COMMENTS").Value)%></textarea>
            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#FFFFFF">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"> <font color="#FF0000">Add your comments here: </font><br>
              <textarea name="Comments" cols="60" rows="6" class="InputBox"></textarea>
            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Original Invoice:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"> 
              <input type="text" name="reqSupDoc" size="60" class="InputBox">
              <input type="button" name="btn1" value="Browse" onClick="opennew('LL_Browse.asp?fname=form1.reqSupDoc')" class="sbttn">
            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#FFFFFF">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td width="30%">&nbsp;</td>
            <td width="15%" bgcolor="#FFFFFF">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Action:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"> 
              <input type="submit" name="Submit" value=" Route Invoice " class="sbttn">
              <input type="button" name="Submit4" value=" Back " class="sbttn" onClick="history.go(-1)">
              <div align="right"><b> </b></div>
            </td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
CompCode.Close()
%>
<%
EXIREG.Close()
%>
